<template>
    <!-- 设备管理-维度分析 -->
    <div class="machMulti">
        <div class="content">
            <div  class="scorll">
                <div class="main">
                    <div class="search">
                        <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>选择设备对象</span>
                            </h2>
                        </div>
                        <div class="list">
                            <RadioGroup v-model="device" @on-change = "getRadio">
                                <Radio  style="width:200px" v-for="item in devicelist" :key="item.id" :label="item.id">{{item.name}}</Radio>
                            </RadioGroup>
                        </div>
                    </div>
                    <div class="search" v-if="mechanical">
                        <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>设备类型</span>
                            </h2>
                        </div>
                        <div class="list">
                            <CheckboxGroup v-model="machIds" style="width:840px">
                                <Checkbox v-for="(val,index) in machTypeList" :key="index" :label="val.id" style="width:200px">
                                    <span style="margin-top:0.2rem">{{val.name}}</span>
                                </Checkbox>
                            </CheckboxGroup>
                        </div>
                    </div>
                    <div class="search" v-if="corpFlag">
                        <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>持有单位</span>
                            </h2>
                        </div>
                        <div class="list">
                            <CheckboxGroup v-model="corpIds" style="width:840px">
                                <Checkbox v-for="(val,index) in corpIdsList" :key="index" :label="val.corpId" style="width:250px">
                                    <span>{{val.corpName}}</span>
                                </Checkbox>
                            </CheckboxGroup>
                        </div>
                    </div>
                    <div class="search">
                        <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>选择数据项</span>
                            </h2>
                        </div>
                        <CheckboxGroup v-model="msgType">
                            <div class="list">
                                <Checkbox v-for="(val,index) in msgList" :key="index" :label="val.id" style="width:200px">
                                    <span>{{val.name}}</span>
                                </Checkbox>
                            </div>
                            <div class="list">
                                <Checkbox v-for="(val,index) in worklist" :key="index" :label="val.id" style="width:200px">
                                    <span>{{val.name}}</span>
                                </Checkbox>
                            </div>
                            <div class="list">
                                <Checkbox v-for="(val,index) in expList" :key="index" :label="val.id" style="width:200px">
                                    <span>{{val.name}}</span>
                                </Checkbox>
                            </div>
                        </CheckboxGroup>
                    </div>
                    <div class="search">
                        <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>选择日期</span>
                            </h2>
                        </div>
                        <div class="list" style="display: flex;justify-content: flex-start;align-items: center;">
                            <div class="item" style="margin-right:20px;">
                                <DatePicker type="date" placeholder="请选择开始日期" style="width: 200px;margin-right:5px" :options="options" v-model="startDate" :clearable="false"></DatePicker>
                            </div>
                            <div class="item" style="margin-right:20px;">
                                <DatePicker type="date" placeholder="请选择结束日期" style="width: 200px" :options="options" v-model="endDate" :clearable="false"></DatePicker>
                            </div>
                            <div class="item" style="margin-right:20px;">
                                <el-button type="primary" @click="searchAll(0)"  style="background:#1891FF;border-radius: 2px;padding:10px 25px;">搜索</el-button>
                                <el-button type="info" @click="clear"  style="margin-left:20px;background:#E2EAFD;border: 1px solid #1891FF;border-radius: 2px;color:#1891FF;padding:10px 25px;" plain>重置</el-button>
                            </div>
                        </div>
                    </div>
                    <div class="search">
                        <div class="title">
                            <h2></h2>
                        </div>
                    </div>
                    <div style="width:100%;position: relative;" >
                        <div class="no_data" v-show="dataList.length == 0">
                            <div>选择完分析对象，数据项和时间范围后，点击搜素即可生成分析数据</div>
                        </div>
                        <div class="data_msg">
                            <div class="chart" v-if="msgType.includes(1)">
                                <div id="mysum" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(2)">
                                <div id="mywork" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(3)">
                                <div id="mydel" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(4)">
                                <div id="myOnline" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(5)">
                                <div id="myOffline" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(6)">
                                <div id="myTime" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(7)">
                                <div id="myeffic" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(8)">
                                <div id="oil" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(9)">
                                <div id="mystabExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(10)">
                                <div id="myefficExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(11)">
                                <div id="mystrengthExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(12)">
                                <div id="mysafeExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(13)">
                                <div id="myoilExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(14)">
                                <div id="mygeneralExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(15)">
                                <div id="myyeildExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                            <div class="chart" v-if="msgType.includes(16)">
                                <div id="mymonthYeildExp" :style="{width: '96%', height: '350px',margin:'20px auto'}"></div>
                            </div>
                        </div>
                    </div>
                    <div class="table" v-show="dataList.length>0">
                            <div class="title">
                            <h2>
                                <span class="bc"></span>
                                <span>设备列表</span>
                            </h2>
                        </div>
                        <table class="create-table">
                            <thead>
                                <tr>
                                    <th>时间</th>
                                    <th>设备类型</th>
                                    <th v-show="msgType.includes(1)">设备总数（台）</th>
                                    <th v-show="msgType.includes(2)">工作设备数（台）</th>
                                    <th v-show="msgType.includes(3)">停机设备数（台）</th>
                                    <th v-show="msgType.includes(4)">在线设备数（台）</th>
                                    <th v-show="msgType.includes(5)">离线设备数（台）</th>
                                    <th v-show="msgType.includes(6)">日均时长（h）</th>
                                    <th v-show="msgType.includes(7)">日均工效（%）</th>
                                    <th v-show="msgType.includes(8)">日均油耗量（L）</th>
                                    <th v-show="msgType.includes(9)">稳定指数</th>
                                    <th v-show="msgType.includes(10)">效率指数</th>
                                    <th v-show="msgType.includes(11)">强度指数</th>
                                    <th v-show="msgType.includes(13)">油耗指数</th>
                                    <th v-show="msgType.includes(12)">安全指数</th>
                                    <th v-show="msgType.includes(14)">综合指数</th>
                                    <th v-show="msgType.includes(15)">日均生产指数</th>
                                </tr>
                            </thead>
                            <tbody v-for="(item,index) in dataList" :key="index">
                                <tr v-for="(row,index) in item.list" :key="index">
                                    <td>{{item.date}}</td>
                                    <td>{{row.name}}</td>
                                    <td v-show="msgType.includes(1)">{{row.machNumTotal}}</td>
                                    <td v-show="msgType.includes(2)">{{row.machNumWork}}</td>
                                    <td v-show="msgType.includes(3)">{{row.machNumIdle}}</td>
                                    <td v-show="msgType.includes(4)">{{row.machNumOnline}}</td>
                                    <td v-show="msgType.includes(5)">{{row.machNumOffline}}</td>
                                    <td v-show="msgType.includes(6)">{{row.workTimes}}</td>
                                    <td v-show="msgType.includes(7)">{{row.effic}}</td>
                                    <td v-show="msgType.includes(8)">{{row.oilWear}}</td>
                                    <td v-show="msgType.includes(9)">{{row.stabExp}}</td>
                                    <td v-show="msgType.includes(10)">{{row.efficExp}}</td>
                                    <td v-show="msgType.includes(11)">{{row.strengthExp}}</td>
                                    <td v-show="msgType.includes(12)">{{row.oilExp}}</td>
                                    <td v-show="msgType.includes(13)">{{row.safeExp}}</td>
                                    <td v-show="msgType.includes(14)">{{row.generalExp}}</td>
                                    <td v-show="msgType.includes(15)">{{row.yeildExp}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { format } from "@/sever/utils.js";
import {
    getMachTypelist,
    getMonthDataListByType_V1,
    getMonthDataListByCorp_V1,
    getCorpList_V1
} from "@/api/mach.js";
export default {
    data() {
        return {
            options: {
                disabledDate(date) {
                    return date > Date.now();
                }
            },
            device: 1,
            machIds: [],
            mechanical: true,
            corpFlag: false,
            workarea: "",
            project: "",
            area: "",
            endDate: new Date(),
            startDate: new Date(new Date().valueOf() - 604800000),
            devicelist: [
                {
                    id: 1,
                    name: "设备类型"
                },
                {
                    id: 2,
                    name: "持有单位"
                },
            ],
            machTypeList: [],
            corpIds:[],
            corpIdsList: [],
            flag: false,
            workareaList: [],
            workareaType: [],
            workteamType: [],
            workteamList: [],
            list: [],
            worklist: [
                {
                    id: 1,
                    name: "设备总数"
                },
                {
                    id: 2,
                    name: "工作设备数	"
                },
                {
                    id: 3,
                    name: "停机设备数	"
                },
                {
                    id: 4,
                    name: "在线设备数"
                },
                {
                    id: 5,
                    name: "离线设备数"
                }
            ],
            msgList: [
                {
                    id: 6,
                    name: "日均时长"
                },
                {
                    id: 7,
                    name: "日均工效"
                },
                {
                    id: 8,
                    name: "日均油耗量"
                }
            ],
            expList: [
                {
                    id: 9,
                    name: "稳定指数"
                },
                {
                    id: 10,
                    name: "效率指数"
                },
                {
                    id: 11,
                    name: "强度指数"
                },
                {
                    id: 12,
                    name: "安全指数"
                },
                {
                    id: 13,
                    name: "油耗指数"
                },
                {
                    id: 14,
                    name: "综合效率指数"
                }
            ],
            colors: [
                "#FA5C90 ",
                "#46D9FF ",
                "#4990FE ",
                "#856DFE ",
                "#FFC880 ",
                "#29b6f6 ",
                "#8bc34a",
                "#fbc02d",
                "#b3e5fc",
                "#ef5350",
                "#4dd0e1",
                "#304ffe",
                "#ff4081",
                "#82b1ff",
                "#6a1b9a",
                "#f57f17",
                "#b71c1c",
                "#a5d6a7",
                "#ffab91",
                "#880e4f",
                "#f8bbd0"
            ],
            msgType: [1, 6, 7, 8],
            all: false,
            dataList: [],
            sumdata: [],
            sumlistdata: [],
            sumlistname: [],
            machNumWorklist: [],
            machNumIdlelist: [],
            machNumOnlinelist: [],
            machNumOfflinelist: [],
            workTimeslist: [],
            efficlist: [],
            stabExplist: [],
            efficExplist: [],
            strengthExplist: [],
            oilExplist: [],
            safeExplist: [],
            generalExplist: [],
            yeildExplist: [],
            msgtypelist: [],
            oilWearlist: [],
            x: "",
            Array: [],
            arr_list: []
        };
    },
    computed: {
        porjectObject() {
            return this.$store.state.porjectObject;
        }
    },
    watch: {
        porjectObject(val, oldVal) {
            if (val.deptId != oldVal.deptId) {
                this.deptIds = val.deptId;
                this.endDate = new Date();
                this.startDate = new Date(new Date().valueOf() - 604800000);
                this.msgType = [1, 6, 7, 8];
                this.workteamType = [];
                this.workteamList = [];
                this.workareaType = [];
                this.workareaList = [];
                this.corpIds = [];
                this.machIds = [];
                this.dataList = [];
                if(this.device == 1){
                   this.getmachTypelist(0,false) 
                } else if (this.device == 2) {
                   this.getCorpListFn();
                }
            }
        },
        device(val) {
            this.datalist();
            this.dataList = [];
            if (val == 1) {
                this.mechanical = true;
                this.corpFlag = false;
                this.corpIds = [];
            } else if (val == 2) {
                this.mechanical = false;
                this.corpFlag = true;
                this.machIds = [];
            }
        }
    },
    methods: {
        getRadio(item){
            if(item == 1) {
                this.getmachTypelist(0,true) 
            } else if (item == 2) {
                this.getCorpListFn();
            }
        },
        //获取设备类型
        getmachTypelist(type,bloe) {
            let params = {
                deptId: this.deptIds
            };
            getMachTypelist(params)
                .then(res => {
                    if (res.code == 200) {
                        this.machIds = [];
                        this.machTypeList = res.data.list;
                        this.machTypeList.forEach((v , i)=>{
                            if(i < 4){
                                this.machIds.push(v.id);
                            }
                        })
                        if(!bloe){
                            if(this.machIds.length>0){
                                this.searchAll(type);
                            }
                        }
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },

        typeChange(value){
            debugger
        },
        getworkTeamType(index) {
            this.workteamType = index;
        },
        datalist() {
            this.sumdata = [];
            this.sumlistdata = [];
            this.sumlistname = [];
            this.machNumWorklist = [];
            this.machNumIdlelist = [];
            this.machNumOnlinelist = [];
            this.machNumOfflinelist = [];
            this.workTimeslist = [];
            this.efficlist = [];
            this.stabExplist = [];
            this.efficExplist = [];
            this.strengthExplist = [];
            this.oilExplist = [];
            this.safeExplist = [];
            this.generalExplist = [];
            this.yeildExplist = [];
            this.msgtypelist = [];
            this.oilWearlist = [];
            this.Array = [];
            this.arr_list = [];
        },
        searchAll(type) {
            if(type == 0) {
               this.datalist();
               this.cleanChar();
            }
            if (this.device == "") {
                this.$Modal.warning({
                    title: "您有必填字段",
                    content: "请选择设备对象"
                });
                return;
            }
            if (this.msgType.length == 0) {
                this.$Modal.warning({
                    title: "您有必填字段",
                    content: "请至少选择一项数据"
                });
                return;
            }
            if (this.startDate == "") {
                this.$Modal.warning({
                    title: "您有必填字段",
                    content: "请选择开始日期"
                });
                return;
            }
            if (this.endDate == "") {
                this.$Modal.warning({
                    title: "您有必填字段",
                    content: "请选择结束日期"
                });
                return;
            }
            if (new Date(this.startDate).getTime() > new Date(this.endDate).getTime()) {
                this.$Modal.warning({
                    title: "提示",
                    content: "开始时间不能大于结束时间"
                });
                return;
            }
            let s = format(this.startDate, "YYYY-MM-DD");
            let e = format(this.endDate, "YYYY-MM-DD");
            var url;
            var Array = [];
            for (let i in this.msgType) {
                for (let j of this.msgList) {
                    if (this.msgType[i] == j.id) {
                        this.msgtypelist.push(j);
                    }
                }
            }
            if (this.device == 1) {
                if (this.machIds.length == 0) {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请至少选择一项设备类型"
                    });
                    return;
                }
                this.Array = this.machIds;
                this.arr_list = this.machTypeList;
                let machTypeMap = {}
                this.machIds.forEach(element => {
                    this.machTypeList.forEach(item => {
                        if(element===item.id){
                            machTypeMap[element] = item.name
                        }
                    });
                })
                let params = {
                    deptId: this.deptIds,
                    machTypeMap,
                    columnIds: this.msgType,
                    startDate: s,
                    endDate: e
                };
                getMonthDataListByType_V1(params)
                    .then(res => {
                        if (res.code == 200) {
                            this.dataList = res.data.list;
                            this.success();
                        } else {
                            this.$Message.warning(res.msg);
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            } else if (this.device == 2) {
                this.arr_list = [];
                if (this.corpIds.length == 0) {
                    this.$Modal.warning({
                        title: "您有必填字段",
                        content: "请至少选择一项持有单位"
                    });
                    return;
                }
                this.Array = this.corpIds;
                this.corpIdsList.forEach(i=>{
                    let obj  ={
                        name:i.corpName,
                        id:i.corpId,
                    }
                    this.arr_list.push(obj)
                })
                let corpMap = {}
                this.corpIds.forEach(element => {
                    this.arr_list.forEach(item => {
                        if(element===item.id){
                            corpMap[element] = item.name
                        }
                    })
                });
                let params = {
                    deptId: this.deptIds,
                    corpMap,
                    columnIds: this.msgType,
                    startDate: s,
                    endDate: e
                };
                getMonthDataListByCorp_V1(params)
                    .then(res => {
                        if (res.code == 200) {
                            this.dataList = res.data.list;
                            this.success();
                        } else {
                            this.$Message.warning(res.msg);
                        }
                    })
                    .catch(error => {
                        console.log(error);
                    });
            } 
        },
        success() {
            let o = [];
            let b = [];
            let work_o = [];
            let work_b = [];
            let del_o = [];
            let del_b = [];
            let Online_o = [];
            let Online_b = [];
            let Offline_o = [];
            let Offline_b = [];
            let time_o = [];
            let time_b = [];
            let effic_o = [];
            let effic_b = [];
            let oilWear_o = [];
            let oilWear_b = [];
            let stabExp_o = [];
            let stabExp_b = [];
            let efficExp_o = [];
            let efficExp_b = [];
            let strengthExp_o = [];
            let strengthExp_b = [];
            let oilExp_o = [];
            let oilExp_b = [];
            let safeExp_o = [];
            let safeExp_b = [];
            let generalExp_o = [];
            let generalExp_b = [];
            let yeildExp_o = [];
            let yeildExp_b = [];
            for (let i in this.dataList) {
                this.sumdata.push(this.dataList[i].date); //时间
                let a = [];
                let work_a = [];
                let del_a = [];
                let Online_a = [];
                let Offline_a = [];
                let time_a = [];
                let effic_a = [];
                let oilWear_a = [];
                let stabExp_a = [];
                let efficExp_a = [];
                let strengthExp_a = [];
                let oilExp_a = [];
                let safeExp_a = [];
                let generalExp_a = [];
                let yeildExp_a = [];
                for (let j in this.dataList[i].list) {
                    let x = this.dataList[i].list[j].machNumTotal;
                    let work_x = this.dataList[i].list[j].machNumWork;
                    let del_x = this.dataList[i].list[j].machNumIdle;
                    let Online_x = this.dataList[i].list[j].machNumOnline;
                    let Offline_x = this.dataList[i].list[j].machNumOffline;
                    let time_x = this.dataList[i].list[j].workTimes;
                    let effic_x = this.dataList[i].list[j].effic;
                    let oilWear_x = this.dataList[i].list[j].oilWear;
                    let stabExp_x = this.dataList[i].list[j].stabExp;
                    let efficExp_x = this.dataList[i].list[j].efficExp;
                    let strengthExp_x = this.dataList[i].list[j].strengthExp;
                    let oilExp_x = this.dataList[i].list[j].oilExp;
                    let safeExp_x = this.dataList[i].list[j].safeExp;
                    let generalExp_x = this.dataList[i].list[j].generalExp;
                    let yeildExp_x = this.dataList[i].list[j].yeildExp;
                    a.push(x);
                    work_a.push(work_x);
                    del_a.push(del_x);
                    Online_a.push(Online_x);
                    Offline_a.push(Offline_x);
                    time_a.push(time_x);
                    effic_a.push(effic_x);
                    oilWear_a.push(oilWear_x);
                    stabExp_a.push(stabExp_x);
                    efficExp_a.push(efficExp_x);
                    strengthExp_a.push(strengthExp_x);
                    oilExp_a.push(oilExp_x);
                    safeExp_a.push(safeExp_x);
                    generalExp_a.push(generalExp_x);
                    yeildExp_a.push(yeildExp_x);
                }

                o.push(a);
                work_o.push(work_a);
                del_o.push(del_a);
                Online_o.push(Online_a);
                Offline_o.push(Offline_a);
                time_o.push(time_a);
                effic_o.push(effic_a);
                oilWear_o.push(oilWear_a);
                stabExp_o.push(stabExp_a);
                efficExp_o.push(efficExp_a);
                strengthExp_o.push(strengthExp_a);
                oilExp_o.push(oilExp_a);
                safeExp_o.push(safeExp_a);
                generalExp_o.push(generalExp_a);
                yeildExp_o.push(yeildExp_a);
            }
            for (var i = 0; i < work_o[0].length; i++) {
                work_b[i] = [];
            }
            for (var i = 0; i < work_o.length; i++) {
                for (var j = 0; j < work_o[i].length; j++) {
                    work_b[j][i] = work_o[i][j];
                }
            }
            for (var i = 0; i < o[0].length; i++) {
                b[i] = [];
            }
            for (var i = 0; i < o.length; i++) {
                for (var j = 0; j < o[i].length; j++) {
                    b[j][i] = o[i][j];
                }
            }
            for (var i = 0; i < del_o[0].length; i++) {
                del_b[i] = [];
            }
            for (var i = 0; i < Online_o.length; i++) {
                for (var j = 0; j < Online_o[i].length; j++) {
                    del_b[j][i] = del_o[i][j];
                }
            }

            for (var i = 0; i < Online_o[0].length; i++) {
                Online_b[i] = [];
            }
            for (var i = 0; i < Online_o.length; i++) {
                for (var j = 0; j < Online_o[i].length; j++) {
                    Online_b[j][i] = Online_o[i][j];
                }
            }
            for (var i = 0; i < Offline_o[0].length; i++) {
                Offline_b[i] = [];
            }
            for (var i = 0; i < Offline_o.length; i++) {
                for (var j = 0; j < Offline_o[i].length; j++) {
                    Offline_b[j][i] = Offline_o[i][j];
                }
            }

            for (var i = 0; i < time_o[0].length; i++) {
                time_b[i] = [];
            }
            for (var i = 0; i < time_o.length; i++) {
                for (var j = 0; j < time_o[i].length; j++) {
                    time_b[j][i] = time_o[i][j];
                }
            }

            for (var i = 0; i < effic_o[0].length; i++) {
                effic_b[i] = [];
            }
            for (var i = 0; i < effic_o.length; i++) {
                for (var j = 0; j < effic_o[i].length; j++) {
                    effic_b[j][i] = effic_o[i][j];
                }
            }

            for (var i = 0; i < oilWear_o[0].length; i++) {
                oilWear_b[i] = [];
            }
            for (var i = 0; i < oilWear_o.length; i++) {
                for (var j = 0; j < oilWear_o[i].length; j++) {
                    oilWear_b[j][i] = oilWear_o[i][j];
                }
            }
            for (var i = 0; i < stabExp_o[0].length; i++) {
                stabExp_b[i] = [];
            }
            for (var i = 0; i < stabExp_o.length; i++) {
                for (var j = 0; j < stabExp_o[i].length; j++) {
                    stabExp_b[j][i] = stabExp_o[i][j];
                }
            }

            for (var i = 0; i < efficExp_o[0].length; i++) {
                efficExp_b[i] = [];
            }
            for (var i = 0; i < efficExp_o.length; i++) {
                for (var j = 0; j < efficExp_o[i].length; j++) {
                    efficExp_b[j][i] = efficExp_o[i][j];
                }
            }

            for (var i = 0; i < strengthExp_o[0].length; i++) {
                strengthExp_b[i] = [];
            }
            for (var i = 0; i < strengthExp_o.length; i++) {
                for (var j = 0; j < strengthExp_o[i].length; j++) {
                    strengthExp_b[j][i] = strengthExp_o[i][j];
                }
            }

            for (var i = 0; i < oilExp_o[0].length; i++) {
                oilExp_b[i] = [];
            }
            for (var i = 0; i < oilExp_o.length; i++) {
                for (var j = 0; j < oilExp_o[i].length; j++) {
                    oilExp_b[j][i] = oilExp_o[i][j];
                }
            }

            for (var i = 0; i < safeExp_o[0].length; i++) {
                safeExp_b[i] = [];
            }
            for (var i = 0; i < safeExp_o.length; i++) {
                for (var j = 0; j < safeExp_o[i].length; j++) {
                    safeExp_b[j][i] = safeExp_o[i][j];
                }
            }

            for (var i = 0; i < generalExp_o[0].length; i++) {
                generalExp_b[i] = [];
            }
            for (var i = 0; i < generalExp_o.length; i++) {
                for (var j = 0; j < generalExp_o[i].length; j++) {
                    generalExp_b[j][i] = generalExp_o[i][j];
                }
            }

            for (var i = 0; i < yeildExp_o[0].length; i++) {
                yeildExp_b[i] = [];
            }
            for (var i = 0; i < yeildExp_o.length; i++) {
                for (var j = 0; j < yeildExp_o[i].length; j++) {
                    yeildExp_b[j][i] = yeildExp_o[i][j];
                }
            }
            for (let i in this.arr_list) {
                for (let j in this.Array) {
                    if (this.Array[j] == this.arr_list[i].id) {
                        this.sumlistname.push(this.arr_list[i].name);
                        let obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            } 
                        };
                        let work_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: work_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let del_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: del_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let Online_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: Online_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let Offline_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: Offline_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let time_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: time_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let effic_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: effic_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let oilWear_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: oilWear_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let stabExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: stabExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        let efficExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: efficExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };

                        let strengthExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: strengthExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };

                        let oilExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: oilExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };

                        let safeExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: safeExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };

                        let generalExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: generalExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };

                        let yeildExp_obj = {
                            name: this.arr_list[i].name,
                            type: "line",
                            data: yeildExp_b[j],
                            itemStyle: {
                                normal: {
                                    color: this.colors[i]
                                }
                            }
                        };
                        this.sumlistdata.push(obj);
                        this.machNumWorklist.push(work_obj);
                        this.machNumIdlelist.push(del_obj);
                        this.machNumOnlinelist.push(Online_obj);
                        this.machNumOfflinelist.push(Offline_obj);
                        this.workTimeslist.push(time_obj);
                        this.efficlist.push(effic_obj);
                        this.stabExplist.push(stabExp_obj);
                        this.efficExplist.push(efficExp_obj);
                        this.strengthExplist.push(strengthExp_obj);
                        this.oilExplist.push(oilExp_obj);
                        this.safeExplist.push(safeExp_obj);
                        this.generalExplist.push(generalExp_obj);
                        this.yeildExplist.push(yeildExp_obj);
                        this.oilWearlist.push(oilWear_obj);
                    }
                }
            }
            if (this.msgType.includes(1)) {
                this.Sum();
            }
            if (this.msgType.includes(2)) {
                this.Work();
            }
            if (this.msgType.includes(3)) {
                this.Del();
            }
            if (this.msgType.includes(4)) {
                this.Online();
            }
            if (this.msgType.includes(5)) {
                this.Offline();
            }
            if (this.msgType.includes(6)) {
                this.Time();
            }
            if (this.msgType.includes(8)) {
                this.oilWear();
            }
            if (this.msgType.includes(7)) {
                this.Effic();
            }
            if (this.msgType.includes(9)) {
                this.stabExp();
            }
            if (this.msgType.includes(10)) {
                this.efficExp();
            }
            if (this.msgType.includes(11)) {
                this.strengthExp();
            }
            if (this.msgType.includes(12)) {
                this.safeExp();
            }
            if (this.msgType.includes(13)) {
                this.oilExp();
            }
            if (this.msgType.includes(14)) {
                this.generalExp();
            }
            if (this.msgType.includes(15)) {
                this.yeildExp();
            }
        },
        clear() {
            this.dataList = [];
            this.endDate = new Date();
            this.startDate = new Date(new Date().valueOf() - 604800000);
            this.msgType = [1, 6, 7, 8];
            this.workteamType = [];
            this.workteamList = [];
            this.workareaType = [];
            this.workareaList = [];
            if(this.device == 1){
               this.getmachTypelist(0,false) 
            } else if (this.device == 2) {
               this.getCorpListFn();
            }
            
        },
        //每次搜索时情况图表数据
        cleanChar() {
            if (this.msgType.includes(1)) {
                this.$echarts.init(document.getElementById("mysum")).clear();
            }
            if (this.msgType.includes(2)) {
                this.$echarts.init(document.getElementById("mywork")).clear();
            }
            if (this.msgType.includes(3)) {
                this.$echarts.init(document.getElementById("mydel")).clear();
            }
            if (this.msgType.includes(4)) {
                this.$echarts.init(document.getElementById("myOnline")).clear();
            }
            if (this.msgType.includes(5)) {
                this.$echarts.init(document.getElementById("myOffline")).clear();
            }
            if (this.msgType.includes(6)) {
                this.$echarts.init(document.getElementById("myTime")).clear();
            }
            if (this.msgType.includes(7)) {
                this.$echarts.init(document.getElementById("myeffic")).clear();
            }
            if (this.msgType.includes(8)) {
                this.$echarts.init(document.getElementById("oil")).clear();
            }
            if (this.msgType.includes(9)) {
                this.$echarts.init(document.getElementById("mystabExp")).clear();
            }
            if (this.msgType.includes(10)) {
                this.$echarts.init(document.getElementById("myefficExp")).clear();
            }
            if (this.msgType.includes(11)) {
                this.$echarts.init(document.getElementById("mystrengthExp")).clear();
            }
            if (this.msgType.includes(12)) {
                this.$echarts.init(document.getElementById("mysafeExp")).clear();
            }
            if (this.msgType.includes(13)) {
                this.$echarts.init(document.getElementById("myoilExp")).clear();
            }
            if (this.msgType.includes(14)) {
                this.$echarts.init(document.getElementById("mygeneralExp")).clear();
            }
            if (this.msgType.includes(15)) {
                this.$echarts.init(document.getElementById("myyeildExp")).clear();
            }
        },
        Sum() {
            let Sum = this.$echarts.init(document.getElementById("mysum"));
            Sum.setOption({
                title: {
                    text: "设备总数(台)",
                },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                    data: this.sumlistname,

                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
             
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.sumlistdata
            });
        },
        Work() {
            let Work = this.$echarts.init(document.getElementById("mywork"));
            Work.setOption({
                title: { text: "工作设备数(台)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.machNumWorklist
            });
        },
        Del() {
            let Del = this.$echarts.init(document.getElementById("mydel"));
            Del.setOption({
                title: { text: "停机设备数(台)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.machNumIdlelist
            });
        },
        Online() {
            let Online = this.$echarts.init(
                document.getElementById("myOnline")
            );
            Online.setOption({
                title: { text: "在线设备数(台)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.machNumOnlinelist
            });
        },
        Offline() {
            let Offline = this.$echarts.init(
                document.getElementById("myOffline")
            );
            Offline.setOption({
                title: { text: "离线设备数(台)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.machNumOfflinelist
            });
        },
        Time() {
            let Time = this.$echarts.init(document.getElementById("myTime"));
            Time.setOption({
                title: { text: "日均时长(h)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.workTimeslist
            });
        },
        Effic() {
            let Effic = this.$echarts.init(document.getElementById("myeffic"));
            Effic.setOption({
                title: { text: "日均工效(%)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.efficlist
            });
        },
        oilWear() {
            let oil = this.$echarts.init(document.getElementById("oil"));
            oil.setOption({
                title: { text: "日均耗油量(L)" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.oilWearlist
            });
        },
        stabExp() {
            let stabExp = this.$echarts.init(
                document.getElementById("mystabExp")
            );
            stabExp.setOption({
                title: { text: "稳定指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.stabExplist
            });
        },
        efficExp() {
            let efficExp = this.$echarts.init(
                document.getElementById("myefficExp")
            );
            efficExp.setOption({
                title: { text: "效率指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.efficExplist
            });
        },
        strengthExp() {
            let strengthExp = this.$echarts.init(
                document.getElementById("mystrengthExp")
            );
            strengthExp.setOption({
                title: { text: "强度指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.strengthExplist
            });
        },
        oilExp() {
            let oilExp = this.$echarts.init(
                document.getElementById("myoilExp")
            );
            oilExp.setOption({
                title: { text: "油耗指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.oilExplist
            });
        },
        safeExp() {
            let safeExp = this.$echarts.init(
                document.getElementById("mysafeExp")
            );
            safeExp.setOption({
                title: { text: "安全指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.safeExplist
            });
        },
        generalExp() {
            let generalExp = this.$echarts.init(
                document.getElementById("mygeneralExp")
            );
            generalExp.setOption({
                title: { text: "综合指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.generalExplist
            });
        },
        yeildExp() {
            let yeildExp = this.$echarts.init(
                document.getElementById("myyeildExp")
            );
            yeildExp.setOption({
                title: { text: "日均生产指数" },
                tooltip: {
                    //触发类型：坐标轴触发
                    trigger: 'axis',
                    backgroundColor:'rgba(255,255,255,0.8)',//通过设置rgba调节背景颜色与透明度
                    color:'black',
                    textStyle:{
                        color:'#303030',
                    },
                    extraCssText:'box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);'
                },
                legend: {
                    data: this.sumlistname,
                    left: "4%",
                    right: "4%",
                    type: 'scroll',
                    x: "center",
                    bottom: 0,
                },
                grid: {
                    left: "4%",
                    right: "4%",
                    containLabel: true
                },
                xAxis: {
                    boundaryGap: false,
                    data: this.sumdata
                },
                yAxis: {
                    type: "value",
                    splitLine: {
                        //去除网格线
                        show: true,
                        lineStyle: {
                            type: 'dashed',
                            color:'#BFBFBF'
                        }
                    }
                },
                series: this.yeildExplist
            });
        },
        getCorpListFn() {
            let params = {
                deptId: this.deptIds
            };
            getCorpList_V1(params)
                .then(res => {
                    if (res.code == 200) {
                        this.corpIds = [];
                        this.corpIdsList = res.data.list;
                        this.corpIdsList.forEach((v , i)=>{
                            if(i < 4){
                                this.corpIds.push(v.corpId);                                
                            }
                        })
                    } else {
                        this.$Message.warning(res.msg);
                    }
                })
                .catch(error => {
                    console.log(error);
                });
        },
    },
    mounted() {
        this.deptIds = this.$store.state.porjectObject.deptId;
        this.getmachTypelist(1,false);
        this.getCorpListFn();

        
    },
    created() {}
};
</script>

<style scoped lang="less">
@import "./../../assets/style/themeBase.less";
</style>

<style lang="scss" scoped>
@function pxToRem($val) {
    @return $val/100 + rem;
}
.machMulti {
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
    background: #F5F5F5;
    .content {
        width: 100%;
        height: 100%;
        h1 {
            width: 96%;
            margin: 0 auto;
            padding-top: 20px;
            color: #000;
            font-size: 28px;
        }
        .scorll{
          width: 100%;
          height: 100%;
          overflow-y: scroll;
          .main{
            background: #fff;
            padding: 0 20px;
          }
      }
        .scorll::-webkit-scrollbar {
            width: 6px;
        }
        /*滚动槽*/
        .scorll::-webkit-scrollbar-track {
            -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
            box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
            border-radius: 10px;
        }
        /* 滚动条滑块 */
        .scorll::-webkit-scrollbar-thumb {
            border-radius: 10px;
            background: rgba(0, 0, 0, 0.1);
            -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
            box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
        }
        .scorll::-webkit-scrollbar-thumb:window-inactive {
            background: rgba(255, 0, 0, 0.4);
        }
        .search {
            width: 100%;
            padding: 20px 0;
            padding-bottom: 0;
            box-sizing: border-box;
            .title{
                width: 100%;
                margin: 0 auto;
                position: relative;
                h2{
                    width: 100%;
                    height: 30px;
                    line-height: 30px;
                    background: #E5ECFD;
                    margin: 0 auto;
                    display: flex;
                    justify-content: flex-start;
                    align-items: center;
                    padding-left: 17px;
                    box-sizing: border-box;
                    .bc{
                        width: 5px;
                        height: 15px;
                        background: var(--themeColor);
                        margin-right: 12px;
                    }
                }
            }
            .list{
                width: 90%;
                margin: pxToRem(20) auto;
                margin-bottom: 0;
                /deep/ .ivu-input:hover {
                    border-color: var(--themeColor);
                }
            }
        }
        .down {
            width: 96%;
            margin: 0 auto;
            display: flex;
            justify-content: flex-start;
            padding-bottom: 20px;
            .item1 {
                display: flex;
                justify-content: flex-start;
                // align-items: center;
                span {
                    width: 90px;
                }
            }
            .item2 {
                align-items: center;
            }
            .btn {
                margin-left: 20px;
            }
        }
    }
}
.no_data {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    background: #fff;
    z-index: 99;
    div {
        width: 96%;
        height: 500px;
        line-height: 500px;
        text-align: center;
        margin: 0 auto;
    }
}
.data_msg {
    width: 96%;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    height: auto;
    .chart {
        width: 48%;
        margin-right: 4%;
        height: 420px;
        margin-bottom: 20px;
        background: #fff;
        border-radius: 10px;
        &:nth-child(even) {
            margin-right: 0%;
        }
    }
}
.table {
    // margin-top: 20px;
    padding-bottom: 20px;
    box-sizing: border-box;
    .title{
        width: 100%;
        margin: 0 auto;
        position: relative;
        padding: pxToRem(20) pxToRem(30);
        box-sizing: border-box;
        h2{
            width: 100%;
            height: 30px;
            line-height: 30px;
            background: #E5ECFD;
            margin: 0 auto;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            padding-left: 17px;
            box-sizing: border-box;
            .bc{
                width: 5px;
                height: 15px;
                background: var(--themeColor);
                margin-right: 12px;
            }
        }
    }
    .create-table {
        padding: pxToRem(20);
        margin: 0 auto;
        border-collapse: collapse;
        color: #5a5a5a;
        // font-size: 16px;
        font-family: 微软雅黑;
        th,
        td {
            // border: 1px solid #E5ECFD;
            border: none;
            padding: 5px;
            text-align: center;
        }
        
        thead tbody {
            border: none;
            // border: 1px solid #f8f8f8;
        }
        tr {
            cursor: pointer;
            height: 48px;
            &:nth-of-type(2n){
                background-color: #F3F6FD;
            }
        }
        td {
            .ico {
                height: 60px;
            }
        }
        th {
            span {
                float: right;
                i {
                    display: block;
                    width: 10px;
                    height: 10px;
                    margin-top: -2px;
                    font-size: 10px;
                    color: #999;
                    // margin-top:20px;
                }
                .classred {
                    color: #546cd5;
                }
            }
            p {
                float: left;
                height: 23px;
                line-height: 23px;
            }
        }
    }
}
</style>


